<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function fun1(){
				alert("即将跳转到百度");
			
				location.href="https://www.baidu.com";
			}
			function fun2(){
				if(confirm("是否跳转到百度")){
					location.href="https://www.baidu.com";
				}
			}
			function fun3(){
				
				location.href=prompt("请输入网址","https://www.baidu.com");
			}
		</script>
	</head>
	<body>
		<button onclick="fun1()">即将跳转到百度</button>
		<button onclick="fun2()">是否跳转到百度</button>
		<button onclick="fun3()">自定义跳转url</button>
	</body>
</html>
